package com.ddw.meedeeuh.shared.movie.database;

import java.io.File;

public abstract class DBExtraThumbFactory {

	public static DBExtraThumb create(int extraThumbId, int movieId, String extraThumbPath) {
		if(extraThumbPath == null || extraThumbPath.trim().length() == 0) {
			throw new IllegalArgumentException("The extra thumb parameter cannot be null or empty");
		}

		final File file = new File(extraThumbPath);
		return new DBExtraThumbImpl(extraThumbId, movieId, file);
	}

	private static class DBExtraThumbImpl implements DBExtraThumb {

		private final File file;
		private final int extraThumbId;
		private final int movieId;

		public DBExtraThumbImpl(int extraThumbId, int movieId, File file) {
			this.file = file;
			this.extraThumbId = extraThumbId;
			this.movieId = movieId;
		}

		@Override
		public File getInstance() {
			return this.file;
		}

		@Override
		public int getExtraThumbId() {
			return this.extraThumbId;
		}

		@Override
		public int getMovieId() {
			return this.movieId;
		}

	}

}
